The wave functions corresponding to the zero energy eigenvalue of a one-dimensional quantum chain Hamiltonian can be written in a simple way using quadratic algebras. Hamiltonians describing stochastic processes have stationary states given by such wave functions and various quadratic algebras were found and applied to several diffusions processes. We show that similar methods can also be applied for equilibrium processes. As an example, for a class of q-deformed O(N) symmetric antiferromagnetic quantum chains, we give the zero energy wave functions for periodic boundary conditions corresponding to momenta zero and $\pi$. We also consider free and various non-diagonal boundary conditions and give the corresponding wave functions. All correlation lengths are derived.